-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(@angular/cli): error out when command json is invalid #12554
Conversation
@@ -2,7 +2,7 @@ | |||
"$schema": "http://json-schema.org/schema", | |||
"$id": "ng-cli://commands/e2e.json", | |||
"description": "Builds and serves an Angular app, and runs end-to-end tests using Protractor.", | |||
"$longDescription": "Must be executed from within a workspace directory.\n When a project name is not supplied, the configured default e2e project of the workspace is used.", | |||
"$longDescription": "./e2e-long.md", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So was this the error that caused the output to be invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was the one. That should be a file path. We output a warning instead of failing before.
The warning would actually happen on every ng
command, not just the help ones. You can see that in https://circleci.com/gh/angular/angular-cli/22079:
Running `ng "version"`...
CWD: /tmp/angular-cli-e2e-118910-90-1pz8kw8.dr34h
ENV: undefined
File /home/circleci/.npm-global/lib/node_modules/@angular/cli/commands/Must be executed from within a workspace directory.
When a project name is not supplied, the configured default e2e project of the workspace is used. was not found while constructing the subcommand e2e.
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 7.0.0-rc.2
Node: 10.9.0
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.9.0-rc.2
@angular-devkit/core 7.0.0-rc.2
@angular-devkit/schematics 7.0.0-rc.2
@schematics/angular 7.0.0-rc.2
@schematics/update 0.9.0-rc.2
rxjs 6.3.3
typescript 3.1.1
5d51689
to
027f003
Compare
fs.writeFileSync(path.join(helpOutputRoot, commandName + '.json'), stdout); | ||
} | ||
// Make sure the output is JSON before printing it, and format it as well. | ||
const jsonOutput = JSON.stringify(JSON.parse(stdout.trim()), undefined, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😻
} | ||
// Make sure the output is JSON before printing it, and format it as well. | ||
const jsonOutput = JSON.stringify(JSON.parse(stdout.trim()), undefined, 2); | ||
fs.writeFileSync(path.join(helpOutputRoot, commandName + '.json'), jsonOutput); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build does not generate the json files. We don’t publish those files to npm.
027f003
to
8d1c0bb
Compare
1 similar comment
Hi @filipesilva! This PR has merge conflicts due to recent upstream merges. |
8d1c0bb
to
dbcf40d
Compare
This lint error resulted from the interaction between angular#12554 and angular#12515.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Related to angular/angular#26391